<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" class="mb-[10px]">
        <el-card shadow="hover">
          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
            <el-form-item label="作业证编号" prop="zyzbh">
              <el-input v-model="queryParams.zyzbh" placeholder="请输入作业证编号" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业申请单位" prop="sqdw">
              <el-input v-model="queryParams.sqdw" placeholder="请输入作业申请单位" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业申请时间" prop="zysqsj">
              <el-date-picker clearable
                v-model="queryParams.zysqsj"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择作业申请时间"
              />
            </el-form-item>
            <el-form-item label="作业申请人" prop="sqr">
              <el-input v-model="queryParams.sqr" placeholder="请输入作业申请人" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业内容" prop="zynr">
              <el-input v-model="queryParams.zynr" placeholder="请输入作业内容" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业位置" prop="zywz">
              <el-input v-model="queryParams.zywz" placeholder="请输入作业位置" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="电源接入点及许可用电功率" prop="jrdydgl">
              <el-input v-model="queryParams.jrdydgl" placeholder="请输入电源接入点及许可用电功率" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="用电设备名称及额定功率" prop="sbmedgl">
              <el-input v-model="queryParams.sbmedgl" placeholder="请输入用电设备名称及额定功率" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="工作电压" prop="gzdy">
              <el-input v-model="queryParams.gzdy" placeholder="请输入工作电压" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="用电人" prop="ydr">
              <el-input v-model="queryParams.ydr" placeholder="请输入用电人" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业人员信息" prop="zyryxx">
              <el-input v-model="queryParams.zyryxx" placeholder="请输入作业人员信息" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业单位类型：1内部，2第三方" prop="zydwlx">
              <el-input v-model="queryParams.zydwlx" placeholder="请输入作业单位类型：1内部，2第三方" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业单位名称" prop="zydwmc">
              <el-input v-model="queryParams.zydwmc" placeholder="请输入作业单位名称" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业负责人" prop="zyfzr">
              <el-input v-model="queryParams.zyfzr" placeholder="请输入作业负责人" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="作业实施开始时间" prop="zysskssj">
              <el-date-picker clearable
                v-model="queryParams.zysskssj"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择作业实施开始时间"
              />
            </el-form-item>
            <el-form-item label="作业实施结束时间" prop="zyssjssj">
              <el-date-picker clearable
                v-model="queryParams.zyssjssj"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择作业实施结束时间"
              />
            </el-form-item>
            <el-form-item label="是否涉及其他特殊作业" prop="sfsjqttszy">
              <el-input v-model="queryParams.sfsjqttszy" placeholder="请输入是否涉及其他特殊作业" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="涉及的其他作业证编号" prop="sjqttszyzbh">
              <el-input v-model="queryParams.sjqttszyzbh" placeholder="请输入涉及的其他作业证编号" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="风险辨识" prop="fxbs">
              <el-input v-model="queryParams.fxbs" placeholder="请输入风险辨识" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="安全交底人" prop="aqjdr">
              <el-input v-model="queryParams.aqjdr" placeholder="请输入安全交底人" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="接受交底人" prop="jsjdr">
              <el-input v-model="queryParams.jsjdr" placeholder="请输入接受交底人" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="监护人" prop="jhr">
              <el-input v-model="queryParams.jhr" placeholder="请输入监护人" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="当前状态：1作业前，2作业中，3作业后" prop="dqzt">
              <el-input v-model="queryParams.dqzt" placeholder="请输入当前状态：1作业前，2作业中，3作业后" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="经度" prop="longitude">
              <el-input v-model="queryParams.longitude" placeholder="请输入经度" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="纬度" prop="latitude">
              <el-input v-model="queryParams.latitude" placeholder="请输入纬度" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="计划开始时间" prop="startTime">
              <el-date-picker clearable
                v-model="queryParams.startTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择计划开始时间"
              />
            </el-form-item>
            <el-form-item label="计划结束时间" prop="endTime">
              <el-date-picker clearable
                v-model="queryParams.endTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择计划结束时间"
              />
            </el-form-item>
            <el-form-item label="视频国标编码" prop="spgbbm">
              <el-input v-model="queryParams.spgbbm" placeholder="请输入视频国标编码" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="防护用品" prop="fhyp">
              <el-input v-model="queryParams.fhyp" placeholder="请输入防护用品" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="附件" prop="attachment">
              <el-input v-model="queryParams.attachment" placeholder="请输入附件" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-form>
        </el-card>
      </div>
    </transition>

    <el-card shadow="never">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:powerWork:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:powerWork:edit']">修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:powerWork:remove']">删除</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:powerWork:export']">导出</el-button>
          </el-col>
          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
      </template>

      <el-table v-loading="loading" border :data="powerWorkList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="主键" align="center" prop="id" v-if="true" />
        <el-table-column label="作业证编号" align="center" prop="zyzbh" />
        <el-table-column label="作业申请单位" align="center" prop="sqdw" />
        <el-table-column label="作业申请时间" align="center" prop="zysqsj" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.zysqsj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="作业申请人" align="center" prop="sqr" />
        <el-table-column label="作业内容" align="center" prop="zynr" />
        <el-table-column label="作业位置" align="center" prop="zywz" />
        <el-table-column label="电源接入点及许可用电功率" align="center" prop="jrdydgl" />
        <el-table-column label="用电设备名称及额定功率" align="center" prop="sbmedgl" />
        <el-table-column label="工作电压" align="center" prop="gzdy" />
        <el-table-column label="用电人" align="center" prop="ydr" />
        <el-table-column label="作业人员信息" align="center" prop="zyryxx" />
        <el-table-column label="作业单位类型：1内部，2第三方" align="center" prop="zydwlx" />
        <el-table-column label="作业单位名称" align="center" prop="zydwmc" />
        <el-table-column label="作业负责人" align="center" prop="zyfzr" />
        <el-table-column label="作业实施开始时间" align="center" prop="zysskssj" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.zysskssj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="作业实施结束时间" align="center" prop="zyssjssj" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.zyssjssj, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="是否涉及其他特殊作业" align="center" prop="sfsjqttszy" />
        <el-table-column label="涉及的其他作业证编号" align="center" prop="sjqttszyzbh" />
        <el-table-column label="风险辨识" align="center" prop="fxbs" />
        <el-table-column label="安全交底人" align="center" prop="aqjdr" />
        <el-table-column label="接受交底人" align="center" prop="jsjdr" />
        <el-table-column label="监护人" align="center" prop="jhr" />
        <el-table-column label="当前状态：1作业前，2作业中，3作业后" align="center" prop="dqzt" />
        <el-table-column label="经度" align="center" prop="longitude" />
        <el-table-column label="纬度" align="center" prop="latitude" />
        <el-table-column label="计划开始时间" align="center" prop="startTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="计划结束时间" align="center" prop="endTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="视频国标编码" align="center" prop="spgbbm" />
        <el-table-column label="防护用品" align="center" prop="fhyp" />
        <el-table-column label="附件" align="center" prop="attachment" />
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-tooltip content="修改" placement="top">
              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:powerWork:edit']"></el-button>
            </el-tooltip>
            <el-tooltip content="删除" placement="top">
              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:powerWork:remove']"></el-button>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>

      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </el-card>
    <!-- 添加或修改临时用电作业对话框 -->
    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
      <el-form ref="powerWorkFormRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="作业证编号" prop="zyzbh">
          <el-input v-model="form.zyzbh" placeholder="请输入作业证编号" />
        </el-form-item>
        <el-form-item label="作业申请单位" prop="sqdw">
          <el-input v-model="form.sqdw" placeholder="请输入作业申请单位" />
        </el-form-item>
        <el-form-item label="作业申请时间" prop="zysqsj">
          <el-date-picker clearable
            v-model="form.zysqsj"
            type="datetime"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择作业申请时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="作业申请人" prop="sqr">
          <el-input v-model="form.sqr" placeholder="请输入作业申请人" />
        </el-form-item>
        <el-form-item label="作业内容" prop="zynr">
          <el-input v-model="form.zynr" placeholder="请输入作业内容" />
        </el-form-item>
        <el-form-item label="作业位置" prop="zywz">
          <el-input v-model="form.zywz" placeholder="请输入作业位置" />
        </el-form-item>
        <el-form-item label="电源接入点及许可用电功率" prop="jrdydgl">
          <el-input v-model="form.jrdydgl" placeholder="请输入电源接入点及许可用电功率" />
        </el-form-item>
        <el-form-item label="用电设备名称及额定功率" prop="sbmedgl">
          <el-input v-model="form.sbmedgl" placeholder="请输入用电设备名称及额定功率" />
        </el-form-item>
        <el-form-item label="工作电压" prop="gzdy">
          <el-input v-model="form.gzdy" placeholder="请输入工作电压" />
        </el-form-item>
        <el-form-item label="用电人" prop="ydr">
          <el-input v-model="form.ydr" placeholder="请输入用电人" />
        </el-form-item>
        <el-form-item label="作业人员信息" prop="zyryxx">
          <el-input v-model="form.zyryxx" placeholder="请输入作业人员信息" />
        </el-form-item>
        <el-form-item label="作业单位类型：1内部，2第三方" prop="zydwlx">
          <el-input v-model="form.zydwlx" placeholder="请输入作业单位类型：1内部，2第三方" />
        </el-form-item>
        <el-form-item label="作业单位名称" prop="zydwmc">
          <el-input v-model="form.zydwmc" placeholder="请输入作业单位名称" />
        </el-form-item>
        <el-form-item label="作业负责人" prop="zyfzr">
          <el-input v-model="form.zyfzr" placeholder="请输入作业负责人" />
        </el-form-item>
        <el-form-item label="作业实施开始时间" prop="zysskssj">
          <el-date-picker clearable
            v-model="form.zysskssj"
            type="datetime"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择作业实施开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="作业实施结束时间" prop="zyssjssj">
          <el-date-picker clearable
            v-model="form.zyssjssj"
            type="datetime"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择作业实施结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="是否涉及其他特殊作业" prop="sfsjqttszy">
          <el-input v-model="form.sfsjqttszy" placeholder="请输入是否涉及其他特殊作业" />
        </el-form-item>
        <el-form-item label="涉及的其他作业证编号" prop="sjqttszyzbh">
          <el-input v-model="form.sjqttszyzbh" placeholder="请输入涉及的其他作业证编号" />
        </el-form-item>
        <el-form-item label="风险辨识" prop="fxbs">
          <el-input v-model="form.fxbs" placeholder="请输入风险辨识" />
        </el-form-item>
        <el-form-item label="安全交底人" prop="aqjdr">
          <el-input v-model="form.aqjdr" placeholder="请输入安全交底人" />
        </el-form-item>
        <el-form-item label="接受交底人" prop="jsjdr">
          <el-input v-model="form.jsjdr" placeholder="请输入接受交底人" />
        </el-form-item>
        <el-form-item label="监护人" prop="jhr">
          <el-input v-model="form.jhr" placeholder="请输入监护人" />
        </el-form-item>
        <el-form-item label="当前状态：1作业前，2作业中，3作业后" prop="dqzt">
          <el-input v-model="form.dqzt" placeholder="请输入当前状态：1作业前，2作业中，3作业后" />
        </el-form-item>
        <el-form-item label="经度" prop="longitude">
          <el-input v-model="form.longitude" placeholder="请输入经度" />
        </el-form-item>
        <el-form-item label="纬度" prop="latitude">
          <el-input v-model="form.latitude" placeholder="请输入纬度" />
        </el-form-item>
        <el-form-item label="计划开始时间" prop="startTime">
          <el-date-picker clearable
            v-model="form.startTime"
            type="datetime"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择计划开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="计划结束时间" prop="endTime">
          <el-date-picker clearable
            v-model="form.endTime"
            type="datetime"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择计划结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="视频国标编码" prop="spgbbm">
          <el-input v-model="form.spgbbm" placeholder="请输入视频国标编码" />
        </el-form-item>
        <el-form-item label="防护用品" prop="fhyp">
          <el-input v-model="form.fhyp" placeholder="请输入防护用品" />
        </el-form-item>
        <el-form-item label="附件" prop="attachment">
          <el-input v-model="form.attachment" placeholder="请输入附件" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="PowerWork" lang="ts">
import { listPowerWork, getPowerWork, delPowerWork, addPowerWork, updatePowerWork } from '@/api/system/powerWork';
import { PowerWorkVO, PowerWorkQuery, PowerWorkForm } from '@/api/system/powerWork/types';

const { proxy } = getCurrentInstance() as ComponentInternalInstance;

const powerWorkList = ref<PowerWorkVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);

const queryFormRef = ref<ElFormInstance>();
const powerWorkFormRef = ref<ElFormInstance>();

const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
});

const initFormData: PowerWorkForm = {
  id: undefined,
  zyzbh: undefined,
  sqdw: undefined,
  zysqsj: undefined,
  sqr: undefined,
  zynr: undefined,
  zywz: undefined,
  jrdydgl: undefined,
  sbmedgl: undefined,
  gzdy: undefined,
  ydr: undefined,
  zyryxx: undefined,
  zydwlx: undefined,
  zydwmc: undefined,
  zyfzr: undefined,
  zysskssj: undefined,
  zyssjssj: undefined,
  sfsjqttszy: undefined,
  sjqttszyzbh: undefined,
  fxbs: undefined,
  aqjdr: undefined,
  jsjdr: undefined,
  jhr: undefined,
  dqzt: undefined,
  longitude: undefined,
  latitude: undefined,
  startTime: undefined,
  endTime: undefined,
  spgbbm: undefined,
  fhyp: undefined,
  attachment: undefined,
}
const data = reactive<PageData<PowerWorkForm, PowerWorkQuery>>({
  form: {...initFormData},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    zyzbh: undefined,
    sqdw: undefined,
    zysqsj: undefined,
    sqr: undefined,
    zynr: undefined,
    zywz: undefined,
    jrdydgl: undefined,
    sbmedgl: undefined,
    gzdy: undefined,
    ydr: undefined,
    zyryxx: undefined,
    zydwlx: undefined,
    zydwmc: undefined,
    zyfzr: undefined,
    zysskssj: undefined,
    zyssjssj: undefined,
    sfsjqttszy: undefined,
    sjqttszyzbh: undefined,
    fxbs: undefined,
    aqjdr: undefined,
    jsjdr: undefined,
    jhr: undefined,
    dqzt: undefined,
    longitude: undefined,
    latitude: undefined,
    startTime: undefined,
    endTime: undefined,
    spgbbm: undefined,
    fhyp: undefined,
    attachment: undefined,
    params: {
    }
  },
  rules: {
    ydr: [
      { required: true, message: "用电人不能为空", trigger: "blur" }
    ],
    zyryxx: [
      { required: true, message: "作业人员信息不能为空", trigger: "blur" }
    ],
    zysskssj: [
      { required: true, message: "作业实施开始时间不能为空", trigger: "blur" }
    ],
    zyssjssj: [
      { required: true, message: "作业实施结束时间不能为空", trigger: "blur" }
    ],
    sfsjqttszy: [
      { required: true, message: "是否涉及其他特殊作业不能为空", trigger: "blur" }
    ],
    sjqttszyzbh: [
      { required: true, message: "涉及的其他作业证编号不能为空", trigger: "blur" }
    ],
    aqjdr: [
      { required: true, message: "安全交底人不能为空", trigger: "blur" }
    ],
    jsjdr: [
      { required: true, message: "接受交底人不能为空", trigger: "blur" }
    ],
    jhr: [
      { required: true, message: "监护人不能为空", trigger: "blur" }
    ],
    longitude: [
      { required: true, message: "经度不能为空", trigger: "blur" }
    ],
    latitude: [
      { required: true, message: "纬度不能为空", trigger: "blur" }
    ],
    spgbbm: [
      { required: true, message: "视频国标编码不能为空", trigger: "blur" }
    ],
    fhyp: [
      { required: true, message: "防护用品不能为空", trigger: "blur" }
    ],
    attachment: [
      { required: true, message: "附件不能为空", trigger: "blur" }
    ],
  }
});

const { queryParams, form, rules } = toRefs(data);

/** 查询临时用电作业列表 */
const getList = async () => {
  loading.value = true;
  const res = await listPowerWork(queryParams.value);
  powerWorkList.value = res.rows;
  total.value = res.total;
  loading.value = false;
}

/** 取消按钮 */
const cancel = () => {
  reset();
  dialog.visible = false;
}

/** 表单重置 */
const reset = () => {
  form.value = {...initFormData};
  powerWorkFormRef.value?.resetFields();
}

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  handleQuery();
}

/** 多选框选中数据 */
const handleSelectionChange = (selection: PowerWorkVO[]) => {
  ids.value = selection.map(item => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加临时用电作业";
}

/** 修改按钮操作 */
const handleUpdate = async (row?: PowerWorkVO) => {
  reset();
  const _id = row?.id || ids.value[0]
  const res = await getPowerWork(_id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改临时用电作业";
}

/** 提交按钮 */
const submitForm = () => {
  powerWorkFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      buttonLoading.value = true;
      if (form.value.id) {
        await updatePowerWork(form.value).finally(() =>  buttonLoading.value = false);
      } else {
        await addPowerWork(form.value).finally(() =>  buttonLoading.value = false);
      }
      proxy?.$modal.msgSuccess("操作成功");
      dialog.visible = false;
      await getList();
    }
  });
}

/** 删除按钮操作 */
const handleDelete = async (row?: PowerWorkVO) => {
  const _ids = row?.id || ids.value;
  await proxy?.$modal.confirm('是否确认删除临时用电作业编号为"' + _ids + '"的数据项？').finally(() => loading.value = false);
  await delPowerWork(_ids);
  proxy?.$modal.msgSuccess("删除成功");
  await getList();
}

/** 导出按钮操作 */
const handleExport = () => {
  proxy?.download('system/powerWork/export', {
    ...queryParams.value
  }, `powerWork_${new Date().getTime()}.xlsx`)
}

onMounted(() => {
  getList();
});
</script>
